package com.xiaozhu.common.video.adapters;

import android.content.Context;
import android.view.View;

import com.xiaozhu.common.R;
import com.xiaozhu.common.video.viewholder.VideoViewHolder;
import com.xiaozhu.library.adapters.BaseRecyclerAdapter;
import com.xiaozhu.library.entity.BaseEntity;
import com.xiaozhu.video.ListVideoPlayerController;

/**
 * @说明
 * @作者 LY
 * @时间 2017/12/20 17:25
 * @邮箱 2743569843@qq.com
 * @版权 Copyright(c) 2017 LY-版权所有
 * @备注
 */
public class VideoAdapter extends BaseRecyclerAdapter<VideoViewHolder, BaseEntity> {
    private Context context;

    public VideoAdapter(Context context) {
        super(context);
        this.context = context;
    }

    @Override
    public VideoViewHolder createView(View convertView, int viewType) {
        VideoViewHolder videoViewHolder = new VideoViewHolder(convertView, viewType);
        ListVideoPlayerController controller = new ListVideoPlayerController(context);
        videoViewHolder.setController(controller);
        return videoViewHolder;
    }

    @Override
    public void bindData(VideoViewHolder holder, BaseEntity baseEntity, int position) {
        holder.bindData();
    }

    @Override
    public int getLayoutResID(int viewType) {
        return R.layout.common_video_item;
    }

}
